package com.dgut.courses_selecting_sys.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.dgut.courses_selecting_sys.anno.ExcelColumn;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * <p>
 *
 * </p>
 *
 * @author yuec
 * @since 2020-08-14
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("sys_course")
public class Course implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "course_id", type = IdType.AUTO)
    private Long courseId;
    @Size(max = 15,min = 1)
    @ExcelColumn(value = "课程名", col = 1)
    private String courseName;

    private Integer deptId;

    /**
     * 人数
     */
    @Min(value = 0,message = "开课人数不能小于0")
    @Max(value = 300,message = "开课人数不能大于300")
    @ExcelColumn(value = "开选人数", col = 8)
    private Integer count;

    @ExcelColumn(value = "开课时间", col = 3)
    private String timetable;

    /**
     * 开课教室
     */
    @ExcelColumn(value = "教室", col = 4)
    private String classroom;
    @Min(value = 0,message = "课程学分不能小于0")
    @Max(value = 10,message = "课程学分不能大于10")
    @ExcelColumn(value = "学分", col = 5)
    private BigDecimal credit;
    @ExcelColumn(value = "状态", col = 6)
    private String status;
    @ExcelColumn(value = "备注", col = 7)
    private String remarks;

    private Long createBy;

    @ExcelColumn(value = "创建人", col = 2)
    private String createByName;

    @ExcelColumn(value = "创建时间", col = 9)
    @TableField(fill = FieldFill.INSERT)
    private Date gmtCreate;

    @TableField(fill = FieldFill.UPDATE)
    private Date gmtModified;

    private Date startChooseTime;

    private Date endChooseTime;

    @TableLogic
    private Integer deleted;


}
